import { Component } from '@angular/core';
import {  NavController, NavParams } from 'ionic-angular';
import { Storage } from '@ionic/storage';
import {Login} from '../../lrf/login/login';
import {ChangePwd} from '../changePwd/changePwd';
import {httpService} from "../../../service/httpService";

/**
 *
 */
@Component({
  selector: 'page-mine',
  templateUrl: 'mine.html',
})
export class Mine {
  userCode;
  userName;
  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    public storage:Storage,
    private http: httpService,
  ) {
    this.storage.get("userInfo").then(data => {
      this.userCode=data.userCode;
      this.userName =data.userName ;
    });
  }
  //修改密码
  toChangePwd(){
    this.navCtrl.push(ChangePwd);
  }
  //退出登录
  logout(){
    this.storage.remove('isLogin');
    this.storage.remove('userInfo');
    this.storage.remove('token');
    this.navCtrl.push(Login);
  }
}
